﻿if (typeof(app) === 'undefined') {
     app = {};
} if (typeof(app.models) === 'undefined') {
       app.models = {};
}

app.models.Employee = Backbone.Model.extend({
    defaults: { Id: '', Name: '', Salutation: 'Mr.', EmailAddress: '' },
    idAttribute: 'Id',
    urlRoot: 'api/employee',
    Name: [{ required: true }, { maxLength: 30 }],
    Salutation: [{ minLength: 2 }],
    EmailAddress: [{
        msg: 'The field is not a valid e-mail address.',
        pattern: 'email'
    }]
});

